var oldObjArrayTemp = new Array();
var setRowObjArrayTemp = new Array();
var  linkClick = true;
//////////////Start Temp Page ////////////////
function searchAlltempPage(value,e){
	/*if (e.keyCode == 13 && !e.ctrlKey) {
		getReservationRoomTempManageMent("textSearch",value)
		$("#SearchAll_tempPage").val("");
		$("#SearchAll_tempPage").select();
	}*/
}
function getReservationRoomTempManageMent(data,valueSearch){
	clearData();
	waitingDialog({});
	var searchName =  $("#SearchAll_tempPage").val();
	if($("#RowpagerTempListRoomManageMent").val() == null){
		getCurrentTabData().lineTemp = 10;
	}else{
		getCurrentTabData().lineTemp = $("#RowpagerTempListRoomManageMent").val();
	}
	if($("#pagerTempListRoomManageMent").val() == null){
		var pagePointer = 1; 
	}else{
		if(valueSearch!=""&&valueSearch!=undefined){
			var pagePointer = valueSearch; 
		}else{
			var pagePointer = 1;
			getCurrentTabData().pagerNumber = 1;
		}
		//var pagePointer = $("#pagerTempListRoomManageMent").val(); 
	}
	var offfset = (getCurrentTabData().lineTemp*pagePointer)-getCurrentTabData().lineTemp;
	var dataOld =  $("#typeCheckReservationTemp").val();
	var valueDateCheckin = $("#calendar_btw_checkinTemp").attr("dateofBtwCheckinTemp");
	var valueDateCheckout = $("#calendar_btw_checkoutTemp").attr("dateofBtwCheckoutTemp");
	if(valueDateCheckin!=""&&valueDateCheckout!=""){
		var dateCheckin = $("#calendar_btw_checkinTemp").attr("dateofBtwCheckinTemp");
	  	var dateCheckout = $("#calendar_btw_checkoutTemp").attr("dateofBtwCheckoutTemp");
	  	$("#calendar_btw_checkinTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinTemp').attr('dateofBtwCheckinTemp',dateCheckin);
		$('#calendar_btw_checkoutTemp').attr('dateofBtwCheckoutTemp',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;
	}else{
		/*var dateCheckin = new Date().toSystemFormat();
		var dateCheckout= new Date().toSystemFormat();
		$("#calendar_btw_checkinTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinTemp').attr('dateofBtwCheckinTemp',dateCheckin);
		$('#calendar_btw_checkoutTemp').attr('dateofBtwCheckoutTemp',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;*/
	}
	if(data=="TempListRoomManageMent"){
		typeReservationTempFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data,searchName);
	}else if(data=="G"){
		getCurrentTabData().typeReservationTemp = data;
		typeReservationTempFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data,searchName)
	}else if(data=="S"){
		getCurrentTabData().typeReservationTemp = data;
		typeReservationTempFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data,searchName);
	}else if(data=="A"){
		getCurrentTabData().typeReservationTemp = data;
		typeReservationTempFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data,searchName);
	}else if(data == "textSearch"){
		showDataResRoomTempManageMent("textSearch","textSearch");
	}else if(data == "dateSearch"){
		var dataOld =  $("#typeCheckReservationTemp").val();
		var valueDateCheckin = $("#calendar_btw_checkinTemp").attr("dateofBtwCheckinTemp");
		var valueDateCheckout = $("#calendar_btw_checkoutTemp").attr("dateofBtwCheckoutTemp");
		if(valueDateCheckin!=""&&valueDateCheckout!=""){
			var dateCheckin = $("#calendar_btw_checkinTemp").attr("dateofBtwCheckinTemp");
			getCurrentTabData().valueDateCheckin = valueDateCheckin;
			getCurrentTabData().valueDateCheckout = valueDateCheckout;
			var dateCheckout= $("#calendar_btw_checkoutTemp").attr("dateofBtwCheckoutTemp");
			if(dataOld=="G"){
				getCurrentTabData().typeReservationTemp = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllTempGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllTempGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
				}else{
					getCurrentTabData().beforePageTemp = ""; 
					getCurrentTabData().beforeSubTemp = "";
					var link = "/reservationService?func=getReservationAllTempGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomTempManageMent,data);
				}
			}else if(dataOld=="S"){
				getCurrentTabData().typeReservationTemp = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllTempSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllTempSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
				}else{
					getCurrentTabData().beforePageTemp = ""; 
					getCurrentTabData().beforeSubTemp = "";
					var link = "/reservationService?func=getReservationAllTempSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomTempManageMent,data);
				}
			}else if(dataOld=="A"){
				getCurrentTabData().typeReservationTemp = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllTemp&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllTemp&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
				}else{
					getCurrentTabData().beforePageTemp = "";
					getCurrentTabData().beforeSubTemp = "";
					var link = "/reservationService?func=getReservationAllTemp&offset="
						+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
						+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomTempManageMent,data);
				}
			}
		}else{
			$("#calendar_btw_checkinTemp").select();
			closeWaitingDialog();
		}
	}
}
function showDataResRoomTempManageMent(data,output){
	var valueDateCheckin = getCurrentTabData().valueDateCheckin;
	var valueDateCheckout = getCurrentTabData().valueDateCheckout;
	if((valueDateCheckin!=""&&valueDateCheckout!="")&&(valueDateCheckin!=undefined&&valueDateCheckout!=undefined)){
		var dateCheckin = valueDateCheckin;
	  	var dateCheckout = valueDateCheckout;
	  	$("#calendar_btw_checkinTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutTemp").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinTemp').attr('dateofBtwCheckinTemp',dateCheckin);
		$('#calendar_btw_checkoutTemp').attr('dateofBtwCheckoutTemp',dateCheckout);
	}
	// set for pager
	getCurrentTabData().tablePager = "tablepagingTemp";
	getCurrentTabData().pagerNumberField = "pagerTempListRoomManageMent";
	getCurrentTabData().functionGetData = "getReservationRoomTempManageMent";
	getCurrentTabData().pageName = "TempListRoomManageMent";
	getCurrentTabData().pageNavPosition = "pageNavPositionTempReservation";
	getCurrentTabData().trCheck = "trTemp";
	if(getCurrentTabData().typeReservationTempCheckin!=undefined){
		$('#calendar_btw_checkinTemp').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().typeReservationTempCheckin).getFormatedString());
		$('#calendar_btw_checkinTemp').attr('dateofBtwCheckinTemp',getCurrentTabData().typeReservationTempCheckin);
	}
	if(getCurrentTabData().checkinTempCheckout!=undefined){
		$('#calendar_btw_checkoutTemp').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().checkinTempCheckout).getFormatedString());
		$('#calendar_btw_checkoutTemp').attr('dateofBtwCheckoutTemp',getCurrentTabData().checkinTempCheckout);
	}
	if(getCurrentTabData().typeReservationTemp!=undefined){
		$('#typeCheckReservationTemp option[value='+getCurrentTabData().typeReservationTemp+']').attr('selected', 'selected');
	}
	if(data.trim()=="[]"){
		var textDataEmpty = '<tr clearTr="tempReservation" >'+
		'<td colspan="100%" style="text-align:center;" >'+
		dataEmpty+
		'</td>'+
		'</tr>';
		textRoomTemp = textDataEmpty;
		$("[clearTr=tempReservation]").remove();
		$("#TempRoomManageMent_Id_Tr").replaceWith("<tr id=TempRoomManageMent_Id_Tr ></tr>"+textRoomTemp);
		textRoomTemp = '';
	}else{
		$("[clearTr=tempReservation]").remove();
		var objArray = new Array();
		if((data=="textSearch"||data=="G"||data=="S"||data=="A")&&data!="dateSearch"){
			objArray = oldObjArrayTemp;
			objArray = objArray[0];
		}else{
			objArray = JSON.parse(data);
			oldObjArrayTemp = objArray;
			objArray = objArray[0];
		}
		var numberSet = getCurrentTabData().beforePageTemp; 
		var numberSubSet = getCurrentTabData().beforeSubPageTemp;
		sortDateRoommanagement(objArray);
		textRoomTempPrint = '';
			var checkBgColor = 0;
			var countGroup = 0;
			var OldGroupId =0;
			var valueSearch = $("#SearchAll_tempPage").val();
			var typeReservation =  $("#typeCheckReservationTemp").val();
			var firstSelect = "";
			for(var i =0;i<objArray.length;i++){
				if(objArray[i].name!=""&&objArray[i].name!=undefined){
					var nameReservation = objArray[i].name.split(" ");
				}else{
					var nameReservation = "";
				}
				var Objtitle = objArray[i].reservationTitle;
				var ObjgroupId = objArray[i].groupId;
				var ObjId = objArray[i].id;
				
				var checkContinue = checkedFilter(output,valueSearch,nameReservation,firstSelect,Objtitle,ObjgroupId,typeReservation,ObjId);
				if(checkContinue==1){
					continue;
				}
				if(objArray[i].groupId!="0"){
					if(objArray[i].subList!=undefined){
						//	OldGroupId = objArray[i].groupIdString;
							var setDateFormat = new Date(objArray[i].date);
							var setFateFormatCheckout = setDateFormat.addDate(objArray[i].span);
							groupId = objArray[i].groupIdString;
							var splitResIdInGroup = objArray[i].resList.split(",");
							var textSubRes = "";
							var textSubResPrint = "";
							var checkBgColorG =0;
							var StatusResInGroup = "";
							for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
								var DescriptionSubRes = "";
								if(objArray[i].subList[subRes].description!=undefined&&objArray[i].subList[subRes].description!=""){
									DescriptionSubRes = objArray[i].subList[subRes].description;
								}else{
									DescriptionSubRes = "";
								}
								var CheckIn = '<span class="link" onClick="editAfterResTemp('+objArray[i].subList[subRes].id+')">'+BtnCheckinTemp+'</span>';
								var Cancel = '<span class="link" onClick="cancelTempGroup('+objArray[i].subList[subRes].id+','+groupId+')">'+BtnCancelTemp+'</span>';
								var linkReservation = "";
								if(objArray[i].subList[subRes].reservationTitle=="Temp Rooms"){
									linkReservation	= '<td class="spanDataCenter">'+
									'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
											'<span>'+CheckIn+' '+Cancel+'</span>'+
										'</div>'+
									'</td>';
								}else{
									linkReservation	= '<td class="spanDataCenter">'+
									'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
										'</div>'+
									'</td>';
								}
								var setDateFormatRes = new Date(objArray[i].subList[subRes].date);
								var setYearRes = setDateFormatRes.getFullYear();
								var setMonthRes = setDateFormatRes.getMonth();
								var setDayRes = setDateFormatRes.getDate();
								var DateFormatThaiRes = setYearRes+'-'+setMonthRes+'-'+setDayRes;
								var setFateFormatCheckoutRes = setDateFormatRes.addDate(objArray[i].subList[subRes].span);
								var setYearCheckOutRes = setFateFormatCheckoutRes.getFullYear();
								var setMonthCheckOutRes = setFateFormatCheckoutRes.getMonth();
								var setDayCheckOutRes = setFateFormatCheckoutRes.getDate();
								var DateformatThaiCheckoutRes = setYearCheckOutRes+'-'+setMonthCheckOutRes+'-'+setDayCheckOutRes;
								var ShowNameGuest = "";
								/// Name Empty
								if(objArray[i].subList[subRes].name!=undefined){
									ShowNameGuest = objArray[i].subList[subRes].name
								}
								///
								if(objArray[i].subList[subRes].reservationTitle=="Reserved Rooms"){
									StatusResInGroup = statusResv;
								}else if(objArray[i].subList[subRes].reservationTitle=="Checked-out Rooms"){
									StatusResInGroup = statusCheckOut;
								}else if(objArray[i].subList[subRes].reservationTitle=="Temp Rooms"){
									StatusResInGroup = statusTempResv;
								}else if(objArray[i].subList[subRes].reservationTitle=="Cancel Reservation"){
									StatusResInGroup = statusCancelCheckin;
								}else{
									StatusResInGroup = statusCheckin;
								}
								if(checkBgColorG==0){
									statusRecord = 'dataRecordBot';
									checkBgColorG = 1;
								}else{
									statusRecord = 'dataRecordBot';
									checkBgColorG =0;
								}
								var showDisplayGuestname = "";
								if(ShowNameGuest==""){
									showDisplayGuestname = '<tr clearTr=tempReservation class="'+statusRecord+'" onclick="if(linkClick==true)noGuestName();"  id="btnEditS" >';
								}else{
									showDisplayGuestname = '<tr clearTr=tempReservation class="'+statusRecord+'" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')"  id="btnEditS" >';
								}
								var phone = "";
								if(objArray[i].subList[subRes].phone!=null)
									phone = objArray[i].subList[subRes].phone;
								else
									phone = "-";
								var email = "";
								if(objArray[i].subList[subRes].email!=null)
									email = objArray[i].subList[subRes].email;
								else
									email = "-";
								
								var runnumberSub = "";
								if(getCurrentTabData().beforePageTemp!=undefined&&getCurrentTabData().beforePageTemp!=""){
									runnumberSub = (numberSet+1)+"."+(subRes+1);
								}else{
									runnumberSub = (i+1)+"."+(subRes+1);
								}
									textSubRes += showDisplayGuestname+
									'<td colspan="2" class="spanDataCenter">'+
									runnumberSub+
									'</td>'+
									'<td class="spanDataCenter">' +
										'<span>'+objArray[i].subList[subRes].id+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+ShowNameGuest+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+phone+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+email+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].subList[subRes].span+'</span>'+
									'</td>'+
									'<td class="spanDataCenter"> '+
										'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">' +
										'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										StatusResInGroup+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span>'+toCurrencyString(objArray[i].subList[subRes].defaultCherge)+'</span>'+///
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
									'</td>'+
									linkReservation+
									'</tr>';
									
									textSubResPrint += '<tr clearTr="tempReservation" class="dataRecord" onclick="if(linkClick==true&&ShowNameGuest!='+"''"+') { CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')}"  id="btnEditS" >'+
									'<td colspan="2" class="spanDataCenter">'+
									runnumberSub+
									'</td>'+
									'<td class="spanDataCenter">' +
										'<span>'+objArray[i].subList[subRes].id+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+ShowNameGuest+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+phone+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span class="guestName" >'+email+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].subList[subRes].span+'</span>'+
									'</td>'+
									'<td class="spanDataCenter"> '+
										'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">' +
										'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
									'</td>'+
									'<td class="spanDataCenter">'+
										StatusResInGroup+
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span>'+toCurrencyString(objArray[i].subList[subRes].defaultCherge)+'</span>'+///
									'</td>'+
									'<td class="spanDataCenter">'+
										'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
									'</td>'+
									'</tr>';
							}
							///Check StatusGroup
								var obj = objArray[i].subList;
								showStatusResInGroup = checkStatusReservationGroup(obj);
								if(getCurrentTabData().beforePageTemp!=undefined&&getCurrentTabData().beforePageTemp!=""){
									numberSet = numberSet+1;
									number = numberSet;
								}else{
									number = (i+1);
								}
								textRoomTemp += '<tr clearTr=tempReservation class="dataRecordGroup" onclick="if(linkClick) {CallEditReservedPageWithLoadElement(id,'+objArray[i].groupIdString+')}"  id="btnEditG" >'+
								'<td class="spanDataCenter">'+
								number+'(<span id=groupCount'+objArray[i].groupIdString+' >'+objArray[i].resList.split(",").length+'</span>)'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>G'+objArray[i].groupIdString+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].name+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].phone+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].email+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
								'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
								'</td>'+
							'</tr>'+textSubRes;
								textRoomTempPrint += '<tr clearTr=tempReservation class="dataRecordGroup" onclick="if(linkClick) {CallEditReservedPageWithLoadElement(id,'+objArray[i].groupIdString+')}"  id="btnEditG" >'+
								'<td class="spanDataCenter">'+
								number+'(<span id=groupCount'+objArray[i].groupIdString+' >'+objArray[i].resList.split(",").length+'</span>)'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>G'+objArray[i].groupIdString+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].name+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].phone+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="ownerName" >'+objArray[i].email+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
								'<span>'+showStatusResInGroup+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
								'</td>'+
							'</tr>'+textSubResPrint;
								checkBgColor =1;
					}else{
						var DescriptionSubRes = "";
						if(objArray[i].description!=undefined&&objArray[i].description!=""){
							DescriptionSubRes = objArray[i].description;
						}else{
							DescriptionSubRes = "";
						}
						var CheckIn = '<span class="link" onClick="editAfterResTemp('+objArray[i].id+')">'+BtnCheckinTemp+'</span>';
						var Cancel = '<span class="link" onClick="cancelTempGroup('+objArray[i].id+','+groupId+')">'+BtnCancelTemp+'</span>';
						var linkReservation = "";
						if(objArray[i].reservationTitle=="Temp Rooms"){
							linkReservation	= '<td class="spanDataCenter">'+
							'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
									'<span>'+CheckIn+' '+Cancel+'</span>'+
								'</div>'+
							'</td>';
						}else{
							linkReservation	= '<td class="spanDataCenter">'+
							'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
								'</div>'+
							'</td>';
						}
						var setDateFormatRes = new Date(objArray[i].date);
						var setYearRes = setDateFormatRes.getFullYear();
						var setMonthRes = setDateFormatRes.getMonth();
						var setDayRes = setDateFormatRes.getDate();
						var DateFormatThaiRes = setYearRes+'-'+setMonthRes+'-'+setDayRes;
						var setFateFormatCheckoutRes = setDateFormatRes.addDate(objArray[i].span);
						var setYearCheckOutRes = setFateFormatCheckoutRes.getFullYear();
						var setMonthCheckOutRes = setFateFormatCheckoutRes.getMonth();
						var setDayCheckOutRes = setFateFormatCheckoutRes.getDate();
						var DateformatThaiCheckoutRes = setYearCheckOutRes+'-'+setMonthCheckOutRes+'-'+setDayCheckOutRes;
						var ShowNameGuest = "";
						/// Name Empty
						if(objArray[i].name!=undefined){
							ShowNameGuest = objArray[i].name
						}
						///
						if(objArray[i].reservationTitle=="Reserved Rooms"){
							StatusResInGroup = statusResv;
						}else if(objArray[i].reservationTitle=="Checked-out Rooms"){
							StatusResInGroup = statusCheckOut;
						}else if(objArray[i].reservationTitle=="Temp Rooms"){
							StatusResInGroup = statusTempResv;
						}else if(objArray[i].reservationTitle=="Cancel Reservation"){
							StatusResInGroup = statusCancelCheckin;
						}else{
							StatusResInGroup = statusCheckin;
						}
						if(checkBgColorG==0){
							statusRecord = 'dataRecordBot';
							checkBgColorG = 1;
						}else{
							statusRecord = 'dataRecordBot';
							checkBgColorG =0;
						}
						var showDisplayGuestname = "";
						if(ShowNameGuest==""){
							showDisplayGuestname = '<tr clearTr=tempReservation class="'+statusRecord+'"   id="btnEditS" >';
						}else{
							showDisplayGuestname = '<tr clearTr=tempReservation class="'+statusRecord+'" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')"  id="btnEditS" >';
						}
						var phone = "";
						if(objArray[i].phone!=null)
							phone = objArray[i].phone;
						else
							phone = "-";
						var email = "";
						if(objArray[i].email!=null)
							email = objArray[i].email;
						else
							email = "-";
						var runnumberSub = "";
						if(getCurrentTabData().beforePageTemp!=undefined&&getCurrentTabData().beforePageTemp!=""){
							runnumberSub = (numberSet)+"."+(numberSubSet);
							numberSubSet = numberSubSet+1;
						}else{
							runnumberSub = (i+1)+"."+(subRes+1);
						}
						textRoomTemp += showDisplayGuestname+
							'<td colspan="2" class="spanDataCenter">'+
							runnumberSub+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+objArray[i].id+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+ShowNameGuest+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+phone+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+email+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
								'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								StatusResInGroup+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+toCurrencyString(objArray[i].defaultCherge)+'</span>'+//
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
							'</td>'+
							linkReservation+
							'</tr>';
							
						textRoomTempPrint += '<tr clearTr="tempReservation" class="dataRecord" onclick="if(linkClick==true&&ShowNameGuest!='+"''"+') { CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}"  id="btnEditS" >'+
							'<td colspan="2" class="spanDataCenter">'+
							runnumberSub+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+objArray[i].id+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+ShowNameGuest+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+phone+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+email+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
								'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								StatusResInGroup+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+toCurrencyString(objArray[i].defaultCherge)+'</span>'+//
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
							'</td>'+
							'</tr>';
					}
				}else{
					if(output=="textSearch"){
						var valueSearch = $("#SearchAll_tempPage").val();
						
						if(valueSearch!=""){
							if(objArray[i].name!=""){
								var nameReservation = objArray[i].name.split(" ");
							}
							if(!(valueSearch==objArray[i].groupId||valueSearch==objArray[i].id||valueSearch==nameReservation[0])){
								continue;
							}
						}
					}
					res = objArray[i].id;
					var CheckIn = '<span class="link" onClick="editAfterResTemp('+res+')">'+BtnCheckinTemp+'</span>';
					var Cancel = '<span class="link" onClick="cancelTemp('+res+')">'+BtnCancelTemp+'</span>';
					var linkReservation = "";
					if(objArray[i].reservationTitle=="Temp Rooms"){
						linkReservation	= '<td class="spanDataCenter">'+
						'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
								'<span>'+CheckIn+' '+Cancel+'</span>'+
							'</div>'+
						'</td>';
					}else{
						linkReservation	= '<td class="spanDataCenter">'+
						'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;">'+
							'</div>'+
						'</td>';
					}
					var setDateFormat = new Date(objArray[i].date);
					var setFateFormatCheckout = setDateFormat.addDate(objArray[i].span);
					getStatusResInGroup = objArray[i].reservationTitle;
					if(getStatusResInGroup=="Reserved Rooms"){
						showStatusResInGroup = statusResv;
					}else if(getStatusResInGroup=="Checked-out Rooms"){
						showStatusResInGroup = statusCheckOut;
					}else if(getStatusResInGroup=="Temp Rooms"){
						showStatusResInGroup = statusTempResv;
					}else if(getStatusResInGroup=="Cancel Reservation"){
						showStatusResInGroup = statusCancelCheckin;
					}else{
						showStatusResInGroup = statusCheckin;
					}
					if(setDateFormat.getFormatedString()!=undefined){
						if(checkBgColor==0){
							statusRecord = 'dataRecordBot';
							checkBgColor = 1;
						}else{
							statusRecord = 'dataRecordBot';
							checkBgColor =0;
						}
						if(getCurrentTabData().beforePageTemp!=undefined&&getCurrentTabData().beforePageTemp!=""){
							numberSet = numberSet+1;
							number = numberSet;
						}else{
							number = (i+1);
						}
							textRoomTemp += '<tr clearTr=tempReservation class="'+statusRecord+'" onclick="if(linkClick==true){ CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')} " id="btnEditS">'+
							'<td class="spanDataCenter" >'+
							number+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+objArray[i].id+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].name+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].phone+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].email+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
								'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+showStatusResInGroup+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+toCurrencyString(objArray[i].defaultCherge)+'</span>'+//
							'</td>'+
							'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
							'</td>'+
							linkReservation+
						'</tr>';
							textRoomTempPrint += '<tr clearTr=tempReservation class="dataRecord" onclick="if(linkClick==true){ CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}" id="btnEditS">'+
							'<td class="spanDataCenter" >'+
							number+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span>'+objArray[i].id+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].name+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].phone+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="guestName" >'+objArray[i].email+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
								'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+showStatusResInGroup+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+toCurrencyString(objArray[i].defaultCherge)+'</span>'+//
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
							'</td>'+
						'</tr>';
					}
				}
			}
			if(textRoomTemp==""){
				var textDataEmpty = '<tr clearTr="tempReservation" >'+
				'<td colspan="100%" style="text-align:center;" >'+
				dataEmpty+
				'</td>'+
				'</tr>';
				textRoomTemp = textDataEmpty;
			}
			$("#TempRoomManageMent_Id_Tr").replaceWith("<tr id=TempRoomManageMent_Id_Tr ></tr>"+textRoomTemp);
			textPrint = textRoomTempPrint;
			textRoomTemp = "";
			textSubRes = "";
	}
	dateRoomManageMent({checkin:"calendar_btw_checkinTemp",atrcheckin:"dateofBtwCheckinTemp"},{checkout:"calendar_btw_checkoutTemp",atrcheckout:"dateofBtwCheckoutTemp"});
	$(".ui-datepicker-trigger").css("margin-top","2px");
	closeWaitingDialog();
	showDataResRoomManageMentSetPageTemp(data,getCurrentTabData().lineTemp)
}

function showDataResRoomManageMentSetPageTemp(data,output){
	$("[clearTr*=TempReservationPage]").remove();
	objArray = JSON.parse(data);
	objArray = objArray[1];
	var textRoomTempSetpage = "";
	for(var i =0;i<objArray.length;i++){
		var textSubRes = "";
		if(objArray[i].groupId!="0"){
			var statusRecord = "";
			for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
				textSubRes += '<tr clearTr=TempReservationPage  ><td></td></tr>';
			}
			textRoomTempSetpage += '<tr clearTr=TempReservationPage class="trTemp"><td></td></tr>'+textSubRes;
		}else{
			textRoomTempSetpage += '<tr clearTr=TempReservationPage ><td></td></tr>';
		}
	}
	$("[name = TempRoomManageMent_Id_Tr2]").replaceWith("<tr name=TempRoomManageMent_Id_Tr2></tr>"+textRoomTempSetpage);
	textRoomTempSetpage = "";
	textSubRes = "";
	showPager(output);
}

function showDataResRoomManageMentSetCountTemp(data,output){
	var subCount = 0;
	var recCount = 0;
	var objArray = new Array();
	if((data=="textSearch"||data=="G"||data=="S"||data=="A"||data=="reservationType_A"||data=="Checked-out Rooms"||data=="Checked-in Rooms")&&data!="dateSearch"){
		objArray = oldObjArrayTemp;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}else{
		objArray = JSON.parse(data);
		oldObjArrayTemp = objArray;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}
	setRowObjArrayTemp = objArray;
	sortIdRoommanagement(objArray);
	sortIdRoommanagement(objArrayCheck);
	for(var i =0;i<objArray.length;i++){
		if(objArray[i].groupId!="0"){
			if(objArray[i].subList!=undefined){
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					subCount = objArrayCheck[objArrayCheck.length-1].subList.length+1;
					break;
				}
			}else{
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					break;
				}
			}
		}else{
			if(objArrayCheck[objArrayCheck.length-1].id==objArray[i].id){
				recCount = (i+1);
				break;
			}
		}
	}
	getCurrentTabData().beforePageTemp = (recCount);
	getCurrentTabData().beforeSubPageTemp = subCount;
	simpleservice(getCurrentTabData().linkSet,null,showDataResRoomTempManageMent,data);
}

function typeReservationTempFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data,searchName){
	var valueDateCheckin = getCurrentTabData().valueDateCheckin;
	var valueDateCheckout = getCurrentTabData().valueDateCheckout;
	if((valueDateCheckin!=""&&valueDateCheckout!="")&&(valueDateCheckin!=undefined&&valueDateCheckout!=undefined)){
		if(dataOld=="G"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTempGroup&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				var linkSet = "/reservationService?func=getReservationAllTempGroup&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTempGroup&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}else if(dataOld=="S"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTempSingle&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				var linkSet = "/reservationService?func=getReservationAllTempSingle&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTempSingle&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}else if(dataOld=="A"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTemp&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				var linkSet = "/reservationService?func=getReservationAllTemp&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTemp&offset="+
				offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="
				+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}
	}else{
		if(dataOld=="G"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTempGroup&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+(pagePointer-1)+"&dateCheckin=";
				var linkSet = "/reservationService?func=getReservationAllTempGroup&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer+"&dateCheckin=";
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTempGroup&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}else if(dataOld=="S"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTempSingle&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+(pagePointer-1);
				var linkSet = "/reservationService?func=getReservationAllTempSingle&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer;
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTempSingle&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}else if(dataOld=="A"){
			getCurrentTabData().typeReservationTemp = dataOld;
			if(pagePointer>1){
				var link = "/reservationService?func=getReservationAllTemp&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+(pagePointer-1);
				var linkSet = "/reservationService?func=getReservationAllTemp&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer;
				getCurrentTabData().linkSet = linkSet;
				simpleservice(link,null,showDataResRoomManageMentSetCountTemp,getCurrentTabData().lineTemp);
			}else{
				getCurrentTabData().beforePageTemp = ""; 
				getCurrentTabData().beforeSubTemp = "";
				var link = "/reservationService?func=getReservationAllTemp&offset="+offfset+"&line="+getCurrentTabData().lineTemp+"&pagePointer="+pagePointer;
				simpleservice(link,null,showDataResRoomTempManageMent,data);
			}
		}
	}
}